import request from '@/router/axios';

// 获取采购计划列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/purchaseproducedemandinfo/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  })
}
// 搜索产品或物料
export const searchProductMaterial = (materialFlag, materialType, materialName,productNo) => {
  return request({
    url: '/api/hg-public/materialinfo/getMaterialInfo',
    method: 'get',
    params: {
      materialFlag,
      materialType,
      materialName,
      productNo
    }
  })
}

// 保存
export const save = (data) => {
  return request({
    url: '/api/blade-purchase/purchaseproducedemandinfo/save',
    method: 'post',
    data: data
  })
}

// 删除
export const remove = (ids) => {
  return request({
    url: '/api/blade-purchase/purchaseproducedemandinfo/remove',
    method: 'post',
    params: {
      ids
    }
  })
}

//查看&编辑
export const detail = (id) => {
  return request({
    url: '/api/blade-purchase/purchaseproducedemandinfo/detail',
    method: 'get',
    params: {
      id
    }
  })
}
// 提交
export const submit = (id) => {
  return request({
    url: '/api/blade-purchase/purchaseproducedemandinfo/submit',
    method: 'get',
    params: {
      id
    }
  })
}
